<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ include file="/common/taglibs.jsp"%>


<!DOCTYPE html>
<html>
<head>
<%-- <%@ include file="/common/links.jsp"%> --%>
<%@ include file="/common/meta.jsp"%>
<script type="text/javascript">
<!--
	var customergridIdString = "#combinecustomerInfolist";
	var licensegridIdString = "#combinelicenseInfolist";
	jQuery(document)
			.ready(
					function() {
						customerGrid = jQuery(customergridIdString);
						customerGrid
								.jqGrid({
									url : "customerInfoGrid",
									datatype : "json",
									mtype : "GET",
									colModel : [
											{
												name : 'customerInfoId',
												index : 'customerInfoId',
												align : 'center',
												label : '<s:text name="customerInfo.customerInfoId" />',
												hidden : true,
												key : true
											},
											{
												name : 'customerName',
												index : 'customerName',
												align : 'center',
												label : '<s:text name="customerInfo.customerName" />',
												width : 50

											} ],

									jsonReader : {
										root : "pageList", // (2)
										page : "page",
										total : "total",
										records : "records", // (3)
										repeatitems : false
									},

									prmNames : {
										page : "page",
										rows : "pagesize",
										sort : "sortname",
										order : "sortorder"
									},
									rowNum : 10,
									rowList : [ 5, 10, 20, 50, 100, 200 ],
									pager : '#combinecustomerInfopager',
									rownumbers : false,
									sortname : 'customerInfoId',
									sortorder : 'desc',
									//caption : '<s:text name="customerInfoList.title" />',
									height : "500",
									autowidth : true,
									loadui : "disable",
									multiselect : false,
									multiboxonly : true,
									hidegrid : false,
									onSelectRow : function(rowid) {

										var sid = jQuery(this).jqGrid(
												'getGridParam', 'selrow');
										if (!sid) {

										} else {
											var urlString = "licenseInfoGrid";
											urlString = urlString
													+ "?customerId=" + sid;
											$(licensegridIdString).jqGrid('setGridParam', {
												url : urlString,
												page : 1
											}).trigger("reloadGrid");
										}

									},
									gridComplete : function() {
										/* if (jQuery(this).getDataIDs().length > 0) {
											jQuery(this)
													.jqGrid(
															'setSelection',
															jQuery(this)
																	.getDataIDs()[0]);//默认选中第一行
										} */
									},
									loadComplete : function(data) {
										//resizeJqGrid($(this));
										resizeJqGrid($(this));
										if (data.ajaxStatus === "error")
											alertMsg.error(data.ajaxMessage);

									},
									loadError : function(xhr, st, err) {
										alertMsg.error("Type: " + st
												+ "; Response: " + xhr.status
												+ " " + xhr.statusText);
									}

								});

						 	jQuery(customerGrid).jqGrid('navGrid',
									'#combinecustomerInfopager', {
										edit : false,
										add : false,
										del : false,
										search : false,
										excel : false
									}, {}, {}, {}, {
										multipleSearch : false,
										multipleGroup : false
									});

						/* $("#combinecustomerInfolistId").bind(
								"resize",
								function() {
									resizeGrid($("#combinecustomerInfolist"),
											0, "#combinecustomerInfolistId");
								}); */

						licenseGrid = jQuery(licensegridIdString);
						licenseGrid
								.jqGrid({
									url : "licenseInfoGrid",
									datatype : "json",
									mtype : "GET",
									colModel : [
											{
												name : 'licenseInfoId',
												index : 'licenseInfoId',
												align : 'center',
												label : '<s:text name="licenseInfo.licenseInfoId" />',
												hidden : true,
												key : true
											},
											{
												name : 'customerInfo.customerName',
												index : 'customerInfo.customerName',
												align : 'center',
												label : '<s:text name="customerInfo.customerName" />',
												width : 50

											},
											{
												name : 'genDate',
												index : 'genDate',
												align : 'center',
												label : '<s:text name="licenseInfo.genDate" />',
												width : 50

											},
											{
												name : 'licenseDefineData',
												index : 'licenseDefineData',
												align : 'center',
												label : '<s:text name="licenseInfo.licenseDefineData" />',
												width : 100

											}/* ,
											{
												name : 'licenseData',
												index : 'licenseData',
												align : 'center',
												label : '<s:text name="licenseInfo.licenseData" />',
												width : 100

											} */ ],

									jsonReader : {
										root : "pageList", // (2)
										page : "page",
										total : "total",
										records : "records", // (3)
										repeatitems : false
									},

									prmNames : {
										page : "page",
										rows : "pagesize",
										sort : "sortname",
										order : "sortorder"
									},
									rowNum : 10,
									rowList : [ 5, 10, 20, 50, 100, 200 ],
									pager : '#combinelicenseInfopager',
									rownumbers : false,
									sortname : 'licenseInfoId',
									sortorder : 'desc',
									//caption : '<s:text name="licenseInfoList.title" />',
									height : "500",
									//width:"800",
									autowidth : true,
									loadui : "disable",
									multiselect : true,
									multiboxonly : true,
									hidegrid : false,
									gridComplete : function() {
										if (jQuery(this).getDataIDs().length > 0) {
											jQuery(this)
													.jqGrid(
															'setSelection',
															jQuery(this)
																	.getDataIDs()[0]);//默认选中第一行
										}
									},
									loadComplete : function(data) {
										resizeJqGrid($(this));
										if (data.ajaxStatus === "error")
											alertMsg.error(data.ajaxMessage);

									},
									loadError : function(xhr, st, err) {
										/* alertMsg.error("Type: " + st
												+ "; Response: " + xhr.status
												+ " " + xhr.statusText); */
									}

								});
						jQuery(licenseGrid).jqGrid('navGrid',
								'#combinelicenseInfopager', {
									edit : false,
									add : false,
									del : false,
									search : false,
									excel : false
								}, {}, {}, {}, {
									multipleSearch : false,
									multipleGroup : false
								});
					});


//-->
</script>
</head>
<body>
	<div class="page">
		<div class="pageContent" layoutH="-30" style="width: 49%; float: left;display: block; overflow:hidden;  border: solid 1px #CCC; line-height: 21px;  margin-left: 1px;">
	<table id="combinecustomerInfolist"></table>
					<div id="combinecustomerInfopager"></div>
		</div>
		<div class="pageContent" layoutH="-30" style="width: 49%; float: right;display: block; overflow:hidden; border: solid 1px #CCC; line-height: 21px;  margin-right: 1px;">
<table id="combinelicenseInfolist"></table>
					<div id="combinelicenseInfopager"></div>
		</div>
	</div>
</body>
</html>